(function(){
    const tx = document.querySelector('#tx')
    const discuss = document.querySelector('.discuss')
    const button = document.querySelector('button')
    function get_Value(){
        const div = document.createElement('div')
                div.classList.add('list')
                const name = document.createElement('p')
                name.classList.add('name')
                const text = document.createElement('p')
                text.classList.add('text')
                const time = document.createElement('p')
                time.classList.add('time')

                div.appendChild(name)
                div.appendChild(text)
                div.appendChild(time)

                discuss.insertBefore(div, discuss.querySelector('.list'));

                name.innerHTML = 'Delu'
                text.innerHTML = `${tx.value}`
                time.innerHTML = new Date().toLocaleString()

                tx.value = ''
    }
    button.addEventListener('click',get_Value)
})();